package kofman.test.info;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.Date;

public class getForwordCount {
	static String Today="";//紀錄今天日期
	static final String[] Webdns={"http://stock.wespai.com/rate100"};
	static int[] prices=new int[4];//分紀錄開盤 最高 最低 收盤 四種價錢
	String[] title={"名稱","代號","股價","時間","其他"};
    static final int[] port={80};
	static Date d=new Date();
    static String s;

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		System.out.println("GO");
		getForwordCount coun=new getForwordCount();
		coun.getStockPrice();

	}
	public void getStockPrice(){
		try{ 			
			URL url=new URL(Webdns[1]);
//			int count=0;	
//				int countline=0;
				//HttpURLConnection huc=(HttpURLConnection)url.openConnection();
				BufferedReader reader=new BufferedReader(new InputStreamReader(url.openStream(),"BIG5"));
				String line;
//		    	System.out.println("Get Information form Web!");
//		    	String pattern1 = "(<TD|<td){1}.(class=\"t3){1}(n|t){1}(1|0)?(\"){1}(>){1}";
//		    	String pattern2 = "(</TD>|</td>){1}";
//		    	String pattern3 = "(GenLink2stk){1}|<a href=\"javascript:Link2Stk(.)*\">";
//		    	String pattern4 = "(,){1}";
//		    	String pattern4_1="[0-9]{1,4}[0-1]{1}";
//		    	String pattern5 = "(;)?(</a>)?";
//		    	String pattern6="((.)*\\((AS)){1}|\\)";
//		    	int linecount=0;
		    	while((line=reader.readLine())!=null){
		    		System.out.println(line);
					
				}
				reader.close();
//				count++;

			}catch (Exception e) {

		}


		
	}

}
